import request from '@/router/axios';

export const getList = (page, size, params) => {
        return request({
            url: '/poster/poster/listPageManage',
            method: 'post',
            params: {
                ...params,
                page,
                size,
            }
        })
};
export const getGoodsList = (page, size, params) => {
    return request({
        url: '/base/goodsManage/list',
        method: 'post',
        params: {
            ...params,
            page,
            size,
        }
    })
};
export const getStoreList = (page, size, params) => {
    return request({
        url: '/base/store/listStoreManage',
        method: 'post',
        params: {
            ...params,
            page,
            size,
        }
    })
};
export const getActList = (page, size, params) => {
    return request({
        url: '/activity/activity/listForAdvert',
        method: 'post',
        params: {
            ...params,
            page,
            size,
        }
    })
};
    // 广告位表下拉框
export const getPosList = (apStatus,deleteStatus ) => {
    return request({
        url: '/poster/posterPos/listDicData',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            apStatus,
            deleteStatus
        }

    })
}
    // 广告项目可见范围
export const listTreeByUserOrganization = ( ) => {
    return request({
        url: '/base/organization/listTreeBylevelM',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
        }

    })
}

export const remove = (id) => {
    return request({
        url: '/poster/poster/delete',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            id,
        }
    })
}
// 查询冲突
export const queryConflict = (row) => {
    return request({
        url: '/poster/poster/queryConflict',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: row
    })
}
export const add = (row) => {
    return request({
        url: '/poster/poster/addItem',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: row
    })
}
export const update = (row) => {
    return request({
        url: '/poster/poster/editItem',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: row
    })
}

//获取下拉列表的详情
export const getDetail = (id) => {
    return request({
        url: '/poster/posterPos/detail',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            id
        }
    })
}

export const changeStatus = (userId, status) => {
    return request({
        url: '/poster/poster/changeStatus',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            userId,
            status
        }
    })
}
export const getlistPoster = (orderBy,adApId) => {
    return request({
        url: '/poster/poster/listPoster',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            orderBy,adApId
        }
    })
}
export const listTreeBylevelM = (levelM) => {
    return request({
        url: '/base/organization/listTree',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            levelM
        }
    })
}
export const commodity = (id) => {
    return request({
        url: '/base/goodsManage/detail',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            id
        }
    })
}
export const activity = (id) => {
    return request({
        url: '/activity/activity/detail',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            id
        }
    })
}

export const auditAdvertNumber = () => {
    return request({
        url: '/poster/poster/auditAdvertNumber',
        method: 'get',
        // meta: {
        //     isSerialize: true,
        // },
    })
}

